<?php

session_start();


if (empty($_SESSION['user'])) {
    $username = $_REQUEST['username'];
    $password = $_REQUEST['password'];

    if ($username == 'admin' && $password == '123') {
        $_SESSION['user'] = ["username" => $username];
        echo "登录成功!";
    } else {
        header("location:user.html");
    }
}